package com.cn.web.controller.EM.ng;

import com.alibaba.fastjson2.JSONObject;
import com.cn.bean.vo.EM.partRegt.BarkPar;
import com.cn.mapper.dao.db5.EM.ng.NGRequestDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@Transactional
@RequestMapping("/NGRequest")
public class NGRequestController {
    private final NGRequestDao ngRequestDao;

    @Autowired(required = false)
    public NGRequestController(NGRequestDao ngRequestDao) {
        this.ngRequestDao = ngRequestDao;
    }

    @RequestMapping("/insert")
    @ResponseBody
    public BarkPar insert(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:aaaaaaaaaaaaaaa" + jsonObject);

        return ngRequestDao.insert(String.valueOf(jsonObject));

    }

    @RequestMapping("/getSing")
    @ResponseBody
    public String getSing(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:aaaaaaaaaaaaaaa" + jsonObject);
        return ngRequestDao.getSing(String.valueOf(jsonObject));
    }

    @RequestMapping("/getList")
    @ResponseBody
    public String getList(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:aaaaaaaaaaaaaaa" + jsonObject);
        String list = ngRequestDao.getList(String.valueOf(jsonObject));
        System.out.println("xxxxxxxxxxxxxx:" + list);
        return list;
    }

    @RequestMapping("/getRack")
    @ResponseBody
    public String getRack(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:eeeeeeee" + jsonObject);
        String list = ngRequestDao.getRack(String.valueOf(jsonObject));
        System.out.println("xxxxxxxxaaxxxxxx:" + list);
        return list;
    }

    @RequestMapping("/getInfo")
    @ResponseBody
    public String getInfo(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ccccccccccc" + jsonObject);
        String list = ngRequestDao.getInfo(String.valueOf(jsonObject));
        System.out.println("assxxxxxxxxxx:" + list);
        return list;
    }

    @RequestMapping("/stateUp")
    @ResponseBody
    public BarkPar stateUp(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ccccccccccc" + jsonObject);
        return ngRequestDao.stateUp(String.valueOf(jsonObject));
    }

    @RequestMapping("/supplier")
    @ResponseBody
    public String supplier(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ccccccccccc" + jsonObject);
        String list = ngRequestDao.supplier(String.valueOf(jsonObject));
        System.out.println("assxxxxxxxxxx:" + list);
        return list;
    }

    //判定
    @RequestMapping("/getProcess")
    @ResponseBody
    public String getProcess(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ddddsssddddddd" + jsonObject);
        String list = ngRequestDao.getProcess(String.valueOf(jsonObject));
        System.out.println("assxxxxxsssxxxxx:" + list);
        return list;
    }

    @RequestMapping("/insertJudge")
    @ResponseBody
    public BarkPar insertJudge(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ddddsssddddddd" + jsonObject);
        return ngRequestDao.insertJudge(String.valueOf(jsonObject));
    }

    @RequestMapping("/getNGItemBase")
    @ResponseBody
    public String getNGItemBase(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:aaaaaaaaaaa" + jsonObject);
        String list = ngRequestDao.getNGItemBase(String.valueOf(jsonObject));
        System.out.println("eeeeeeeeeeee:" + list);
        return list;
    }

    @RequestMapping("/judgeState")
    @ResponseBody
    public BarkPar judgeState(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ddddsssddddddd" + jsonObject);
        return ngRequestDao.judgeState(String.valueOf(jsonObject));
    }

    //评审
    @RequestMapping("/insertReview")
    @ResponseBody
    public BarkPar insertReview(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ddddsssddddddd" + jsonObject);
        return ngRequestDao.insertReview(String.valueOf(jsonObject));
    }
    @RequestMapping("/ratifyStateUp")
    @ResponseBody
    public BarkPar ratifyStateUp(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ddddsssddddddd" + jsonObject);
        return ngRequestDao.ratifyStateUp(String.valueOf(jsonObject));
    }
}
